Skip to main content

Google Cloud Storage actions

1. About Get Object:

To get the specific items from Google storage cloud, Get Object connector is used.

You can send your access token in "msg.config.token", "msg.req.headers.authorization"

Following message properties can be inside the connector properties if provided.

  • msg.config.context => CONTEXT
  • msg.config.bucket => BUCKET
  • msg.config.fileName => FILE_NAME
  • msg.config.alt => ALT

CONTEXT Provide the name of the context you want to add to global variable. i.e if value of context is "XYZ", then the access token will be stored to the global context data as "GCS_XYZ_ACCESS_TOKEN".

BUCKET Provide the name of bucket you want to fetch data from.

FILE_NAME Provided the name of the file you want to fetch data from.

ALT Alt is type of file in gcs.

Sample msg.config

msg.config = {
context: "XYZ",
bucket: "your-bucket-name",
fileName: "documents/abc.csv",
alt: "media"
};

NOTE: If you don't want to add alt leave it blank.

2. About Get Token:

To Get Access token for accessing google cloud storage, Get token connector is used.

You can send your jwt token in "msg.config.jwtToken", "msg.req.headers.authorization"

Following message properties can be inside the connector properties if provided.

  • msg.config.context => CONTEXT
  • msg.config.algorithm => ALGORITHM
  • msg.config.iss => ISS
  • msg.config.scope => SCOPE
  • msg.config.aud => AUD
  • msg.config.privatekey => PRIVATE_KEY

CONTEXT Provide the name of the context you want to add to global variable. i.e if value of context is "XYZ", then the access token will be stored to the global context data as "GCS_XYZ_ACCESS_TOKEN".

ALGORITHM Provide the algorithm used for generating jwt token from claimset.

ISS Provided the claim identifies the principal that issued the JWT.

SCOPE A scope is simply a grouping of claims.

AUD (Audience) Claim The "aud" (audience) claim identifies the recipients that the JWT is intended for. Each principal intended to process the JWT MUST identify itself with a value in the audience claim.

PRIVATE KEY Private Key JWT is a method of client authentication where the client creates and signs a JWT using its own private key.

Sample msg.config

msg.config = {
context: "XYZ",
iss: "xyz@abc.iam.gserviceaccount.com",
scope: "https://www.googleapis.com/auth/devstorage.read_only",
aud: "https://oauth2.googleapis.com/token",
privatekey: `-----BEGIN PRIVATE KEY-----
{{your-private-key}}
-----END PRIVATE KEY-----`
};

NOTE: Private key should have single break after begin and before end of key.

3. About List All Object:

To get the list of available items from Google storage cloud, Get all object connector is used.

You can send your access token in "msg.config.token", "msg.req.headers.authorization"

Following message properties can be inside the connector properties if provided.

  • msg.config.context => CONTEXT
  • msg.config.bucket => BUCKET
  • msg.config.queryString => QUERY_STRING

CONTEXT Provide the name of the context you want to add to global variable. i.e if value of context is "XYZ", then the access token will be stored to the global context data as "GCS_XYZ_ACCESS_TOKEN".

BUCKET Provide the name of bucket you want to fetch data from.

QUERY_STRING Mention query parameter string to add to URL. e.g "prefix=reports&type=csv"

Sample msg.config

msg.config = {
context: "ABC",
bucket: "your-bucket-name",
queryString: "prefix=reports&type=csv",
}

NOTE: If you don't want to add query params leave it blank.